package com.ruoyi.system.service;

import java.math.BigDecimal;
import java.util.List;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.AppDynamicMsg;
import com.ruoyi.system.domain.AppUser;

/**
 * app用户Service接口
 *
 * @author ruoyi
 * @date 2023-02-27
 */
public interface IAppUserService extends IService<AppUser> {
    /**
     * 查询app用户
     *
     * @param userId app用户主键
     * @return app用户
     */
    public AppUser selectAppUserByUserId(Long userId);

    /**
     * 查询app用户列表
     *
     * @param appUser app用户
     * @return app用户集合
     */
    public List<AppUser> selectAppUserList(AppUser appUser);

    /**
     * 新增app用户
     *
     * @param appUser app用户
     * @return 结果
     */
    public int insertAppUser(AppUser appUser);

    /**
     * 修改app用户
     *
     * @param appUser app用户
     * @return 结果
     */
    public int updateAppUser(AppUser appUser);

    /**
     * 批量删除app用户
     *
     * @param userIds 需要删除的app用户主键集合
     * @return 结果
     */
    public int deleteAppUserByUserIds(Long[] userIds);

    /**
     * 删除app用户信息
     *
     * @param userId app用户主键
     * @return 结果
     */
    public int deleteAppUserByUserId(Long userId);

    AppUser getById(Long userId);


    AppUser getOneByMobile(String phone);

    /**
     * 通过手机号码和密码
     *
     * @param phone
     * @param password
     * @return
     */
    AppUser getOneByMobileAndPassword(String phone, String password);

    int countByMobile(String phone);

    Integer findByAccount(String num);

    AjaxResult editUserInfo(AppUser user);

    List<AppUser> listByUserIds(List<String> asList);

    List<AppUser> getListByUserIds(List<Object> userId);

    /**
     * 修改用户状态：0：正常，1：冻结
     *
     * @param appUser 状态
     * @return
     */
    int updateAppUserByState(AppUser appUser);

    /**
     * 密码修改
     *
     * @param appUser
     * @return
     */
    int updateAppUserByPassword(AppUser appUser);

    AjaxResult applyWithdrawal(Long userId, BigDecimal money, String address);

    void updateUserBalance(Long userId, BigDecimal negate);

    void updateUserMoneyByReceiveRedPacket(Long userId, BigDecimal bigDecimal);

    AjaxResult updateUserUsdtAddress(Long userId, String collectionAddress);

    void changeUserBalance(BigDecimal money, Long userId, String add, String 充值);
}
